Advanced API Design Problems
Look at more challenging design problems that we will introduce throughout the remainder of the course.
We'll cover the following
By completing the lessons on foundational API design problems, we have equipped ourselves to tackle more advanced design problems. Let's use the foundational design problems for specific functionalities of the advanced design problems. We chose each of these design problems based on the uniqueness of different functionalities. Each functionality leads to a focus on a different design aspect, as we’ll see in the upcoming chapters of the course.
The design problems we will cover in this course#
We have listed each design problem expanded on in this course below:
- YouTube Streaming API Design: A video streaming application like YouTube that provides services where users can upload and watch videos. In the YouTube API design, we’ll model an API that provides real-time playback experience to users. The API also supports video searching, video preview, adaptive bitrate streaming, stitching ads within the stream, and rating operations. We’ll reinforce our learning by designing the TikTok API.
- Messenger API Design: Chat applications such as Messenger connect millions of people around the clock through their extensive set of APIs. In this API design problem, we’ll model an API for a real-time chat application such as Messenger. This API provides services like one-to-one chatting, downloading paginated lists of chat, and sharing of media files.
- Google Maps API Design: This API allows users to search for places, find the shortest possible routes to them, and get navigation directions. In this design problem, we’ll explore how different APIs require different communication protocols and take appropriate design decisions based on the requirements that allow our API to communicate in near real-time. Additionally, we’ll learn how to make the client intelligent to improve Google Maps availability.
- Zoom API Design: In this design problem, we’ll design a video conferencing API, such as Zoom, where users can schedule meetings. We’ll discuss the overall architecture, resource allocation methodologies to facilitate streaming sessions, and approaches to achieve real-time communication using our API to meet the needs of a growing number of users.
- LeetCode API Design: We’ll design a service that integrates different microservices to perform code evaluations, discussions, interviews, and coding contests. The use of a decoupling layer for asynchronous communication between different services to lower the latency will be an important takeaway of this chapter.
- Payment API Design: A payment gateway is a service through which customers can transfer funds to a merchant’s account via a broad variety of payment methods, such as credit or debit cards. In this API design problem, we’ll design an API for a payment gateway, like Stripe, to transfer funds securely from a customer’s to a merchant’s account. The API also has the support of other operations, such as generating charges, invoices, and providing transaction details.
- Twitter API Design: We’ll design a Twitter API that allows users to post, search, comment, and rate Tweets. Additionally, it allows users to access their timelines. We’ll also discuss how the Tweet API interacts with the timeline API to improve the API’s responses for different types of users.
- Uber API Design: We’ll design a ride-sharing service, such as Uber, in this design problem. The API will be used by two different client applications, such as drive and rider. We’ll use the pub-sub service as a building block to efficiently handle the communication between the services of two applications. We’ll also analyze the use of third-party service providers, such as Google Maps, in this API.
- CamelCamelCamel API Design: We’ll design a service to track real-time price drops of Amazon’s products. This design problem is a good example of synchronous communication between service providers. This explains the effects of third-party service providers on technical design decisions due to compatibility and the response time of an API. It also demonstrates the communication patterns with the third-party service provider.
- Gaming API Design: Our goal in this problem is to design an API for the game system, understand how the game system works (the components involved), and how end-to-end communication is established between the player and the game server. We’ll also discuss how our API avoids client-side cheating or hacking and enables real-time communication.
Note that our convention in the foundational design problem was to list all the prerequisite concepts to design the problem. In these advanced design problems, we’ll consider different foundational design problems as prerequisites.
Let's begin designing more complex problems!
Pub-Sub API Design Evaluation and Latency Budget
Requirements of the YouTube API